package com.ygsoft.tianlu_mall.service.impl;

import com.ygsoft.tianlu_mall.mapper.NumMapper;
import com.ygsoft.tianlu_mall.service.NumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;

@Service
public class NumServiceImpl implements NumService {
    @Autowired
    NumMapper numMapper;


    public HashMap<String,Object> getThreeNum(int goods_id){
        HashMap<String,Object> result = new HashMap<>();
        int saleNum = numMapper.getSaleNum(goods_id);
        int collectNum = numMapper.getCollectNum(goods_id);
        int evaluation = numMapper.getEvaluationNum(goods_id);
        result.put("goods_id",goods_id);
        result.put("saleNum",saleNum);
        result.put("collectNum",collectNum);
        result.put("evaluation",evaluation);
        return result;
    }
}
